package br.com.maandli.everstrip;

import android.os.Bundle;
import android.support.v7.app.ActionBarActivity;
import android.view.Menu;
import android.view.MenuItem;

public class MainActivity extends ActionBarActivity {

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);
        getSupportActionBar().setDisplayHomeAsUpEnabled(true);
     }

    @Override
    protected void onPause() {
        super.onPause();
        //TODO: Save user preferences
    }

    @Override
    protected void onResume() {
        super.onResume();
        //TODO: Load user preferences
        //TODO: Check if is online and set appropriate flags
        //TODO: Load current strip
        //TODO: Cache next strips
    }

    @Override
    protected void onStop() {
        super.onStop();
        //TODO: Save last strip seen
        //TODO: Release all handlers and listeners
    }

    @Override
    protected void onStart() {
        super.onStart();
        //TODO: Create all handlers and listeners
    }

    @Override
    public boolean onCreateOptionsMenu(Menu menu) {
        // Inflate the menu; this adds items to the action bar if it is present.
        getMenuInflater().inflate(R.menu.main, menu);
        return super.onCreateOptionsMenu(menu);
    }

    @Override
    public boolean onOptionsItemSelected(MenuItem item) {
        // Handle action bar item clicks here. The action bar will
        // automatically handle clicks on the Home/Up button, so long
        // as you specify a parent activity in AndroidManifest.xml.
        int id = item.getItemId();
        switch (id) {
            case R.id.menu_preferences:
                //openAdvancedSetup();
                return true;
            case R.id.menu_first_unseen:
                //openFirstUnseen();
                return true;
            case R.id.menu_random:
                //openRandomStrip();
                return true;
            case R.id.menu_today:
                //openTodayStrip();
                return true;
            case R.id.menu_calendar:
                //openCalendar();
                return true;
            case R.id.menu_share:
                //openShareStrip();
                return true;
            case R.id.menu_save:
                //openSaveStrip();
                return true;
            case R.id.menu_first:
                //openFirstStrip();
                return true;
            case R.id.menu_checkDBTotals:
                //openCheckDBTotals();
                return true;
            default:
                return super.onOptionsItemSelected(item);
        }
    }

}
